package dxcorp.dxadminapi.service.impl;

import dxcorp.dxadminapi.entity.waferinfo;
import dxcorp.dxadminapi.mapper.waferinfoMapper;
import dxcorp.dxadminapi.service.waferinfoService;
import dxcorp.dxadminapi.utils.PageResult;
import dxcorp.dxadminapi.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WaferinfoServiceImpl implements waferinfoService {
    @Autowired
    private waferinfoMapper waferinfoMapper;

    @Override
    public PageResult getWaferInfoPage(PageUtil pageUtil) {
        List<waferinfo> waferinfo = waferinfoMapper.findwaferinfo(pageUtil);
        int total = waferinfoMapper.getTotalwaferinfo(pageUtil);
        PageResult pageResult = new PageResult(waferinfo, total, pageUtil.getLimit(), pageUtil.getPage());
        return pageResult;
    }

    @Override
    public int save(waferinfo bzsbasic) {
        return waferinfoMapper.insertwaferinfo(bzsbasic);
    }

    @Override
    public Integer update(waferinfo bzsbasic) {
        System.out.println(bzsbasic.getCET());
        return waferinfoMapper.updatewaferinfo(bzsbasic);
    }

    @Override
    public int delete(Integer id) {
        return waferinfoMapper.delwaferinfo(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return waferinfoMapper.deleteBatch(ids);
    }
}
